from django.db import models
from users.models import User
from goods.models import HuaweiGoods

# Create your models here.
class Shopcar(models.Model):
    objects = models.Manager()
    shopcarowner = models.ForeignKey(
        User, on_delete=models.CASCADE, related_name="shopcaruser"
    )
    shopcargoods = models.ForeignKey(
        HuaweiGoods, on_delete=models.CASCADE, related_name="shopcargoods"
    )
    add_time = models.DateTimeField("加入购物车时间", auto_now_add=True)

    class Meta:
        verbose_name = "用户购物车"
        verbose_name_plural = verbose_name

    # def __str__(self):
    #     return self.shopcarowner